//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;
using System.Configuration;

namespace EntLibContrib.Resource.Configuration
{
	/// <summary>
	/// Configuration data defining ResourceProviderData. Defines the information needed to properly configure
	/// a ResourceProvider instance.
	/// </summary>
	public abstract class ResourceProviderData : ResourceProviderDataBase
	{
		#region Constants
		/// <summary>
		/// Resource base name property name
		/// </summary>
		private const string resourceBaseNameProperty = "resourceBaseName";
		#endregion

		#region Properties
		/// <summary>
		/// Base name of the Resources to use.
		/// </summary>
		/// <value>The name of the resource base.</value>
		[ConfigurationProperty(resourceBaseNameProperty, IsRequired = true)]
		public string ResourceBaseName
		{
			get { return (string)base[resourceBaseNameProperty]; }
			set {  base[resourceBaseNameProperty] = value; }
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="ResourceProviderData"/> class.
		/// </summary>
		protected ResourceProviderData ()
		{
		}

		/// <summary>
		/// Initialize a new instance of the <see cref="ResourceProviderData"/> class with a name and the type of <see cref="IResourceProvider"/>.
		/// </summary>
		/// <param name="name">The name of the configured <see cref="IResourceProvider"/>.</param>
		/// <param name="type">The type of <see cref="IResourceProvider"/>.</param>
		/// <param name="resourceBaseName">Name of the resource base.</param>
		protected ResourceProviderData(string name, Type type, string resourceBaseName)
			: base(name, type)
		{
			this.ResourceBaseName = resourceBaseName;
		}
		#endregion
	}
}